<template>
  <a-checkbox-group
    v-model:value="val"
    name="checkboxgroup"
    :options="options"
    @change="change"
    :disabled="isDisabled"
  />
</template>

<script>
import { ref } from "@vue/reactivity";
export default {
  props: {
    options: {
      //选项
      type: Array,
      required: true,
    },
    currentVal: {
      //当前选中值
      type: Array,
      required: true,
    },
    isDisabled: {
      //是否禁用
      type: Boolean,
      default: false,
    },
  },
  setup(props, { emit }) {
    const val = ref(props.currentVal);
    const change = (e) => {
      emit("update:currentVal", e);
    };
    return {
      val,
      change,
    };
  },
};
</script>

<style>
</style>